<?php session_start();
	$TenSP = $_POST["tbxTenSP"];
	$MoTa = $_POST["tbxMoTa"];
	$Gia = $_POST["tbxGia"];
	$Url = $_POST["tbxUrl"];
	$SLX = $_POST["tbxSLX"];
	$SLTK = $_POST["tbxSLTK"];
	
	$ts1 = $_POST["HSX"];
	$ts2 = $_POST["Mang"];
	$ts3 = $_POST["KD"];
	$ts4 = $_POST["KT"];
	$ts5 = $_POST["TL"];
	$ts6 = $_POST["MH"];
	$ts7 = $_POST["DPG"];
	$ts8 = $_POST["TB"];
	$ts9 = $_POST["R"];
	$ts10 = $_POST["LTN"];
	$ts11 = $_POST["BNT"];
	$ts12 = $_POST["SMS"];
	$ts13 = $_POST["GPRS"];
	$ts14 = $_POST["EDGE"];
	$ts15 = $_POST["3G"];
	$ts16 = $_POST["TD"];
	$ts17 = $_POST["Blue"];
	$ts18 = $_POST["W"];
	$ts19 = $_POST["USB"];
	$ts20 = $_POST["Cam"];
	$ts21 = $_POST["Mau"];
	$ts22 = $_POST["HDH"];
	$ts23 = $_POST["Pin"];
	$ts24 = $_POST["TGDT"];
	$ts25 = $_POST["TGC"]; ?>
<!DOCTYPE HTML>
<html>
<head>
<?php include "head.php";?>
<title>Trang quản lý website</title>
	
</head>
<body>

<div id="big">
<div id="main">
<?php
	include "dbcon.php";
	$temp = 1;

   $check =	mysql_query("insert into sanpham values ('null', '$TenSP', '$MoTa' ,'$Gia','$Url', '$SLX', '$SLTK', ' ')");
   $Max = mysql_fetch_array(mysql_query("select max(masp) from sanpham"));
	if ($check == true)
	{
		for ($i = 1 ; $i < 26 ; $i++)
		{
			
			$ts = "ts$i";
			 $ks = $$ts;
			echo "$ks"; 
			$check2 = mysql_query("insert into tskt values ('$Max[0]','$ks' )");
			if($check2 == false)
			{
			$temp = 0;
			}	
		}
		if($temp == 1)
		echo "Thêm thành công.";
		else
		echo "Thêm thất bại !!!";		
	}
	

 ?>
